Skip to content

Conversation

@peter-mitsis
Copy link
Contributor

Inspection of the build log shows that the arcmwdt toolchain overrides the enablement of MINIMAL_LIBC and PICOLIBC to use its own libc. When this happens, it can lead to build errors that stem from redefinition of various types. To account for this, the filters have been extended to catch this.

@peter-mitsis
Copy link
Contributor Author

Not sure if the proposed method of filtering is the best/ideal way, so if anyone knows a better way, I am all ears. :)

@zephyrbot zephyrbot added area: C Library C Standard Library area: Tests Issues related to a particular existing or missing test labels Oct 28, 2025
@cfriedt
Copy link
Member

cfriedt commented Oct 28, 2025

Isn't there an ARCMWDT libc Kconfig that could be used? Not sure if this change is ideal. It would also be good to see what @M-Moawad thinks.

@M-Moawad
Copy link
Contributor

I’m seeing this same warning, but it’s not specific to this particular test. It appears for all tests that configure a libc other than the default one when using the ARCMWDT toolchain.

warning: The choice symbol PICOLIBC (defined at lib/libc/Kconfig:100) was selected (set =y), but
MINIMAL_LIBC (defined at lib/libc/Kconfig:86) ended up as the choice selection. See
http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_PICOLIBC and/or look up PICOLIBC in the
menuconfig/guiconfig interface. The Application Development Primer, Setting Configuration Values,
and Kconfig - Tips and Best Practices sections of the manual might be helpful too.

Since this behavior affects all such tests, it seems the fix should be made at the libc Kconfig level rather than in the individual test configurations.

For now, I’m not sure what the best solution would be, so let’s discuss and think about the proper way to address this at the Kconfig level.

@peter-mitsis
Copy link
Contributor Author

FWIW, it looks like IAR may have a similar issue (though I have not tested this to verify). This is based on the fact that cmake/toolchain/iar/Kconfig.defconfig also sets PICOLIBC_SUPPORTED to 'n'.

Perhaps the better Kconfig to filter on is PICOLIBC_SUPPORTED instead of PICOLIBC. It is however worth noting that for the libraries.libc.c11_threads.minimal + arcmwdt case, MINIMAL_LIBC_SUPPORTED is insufficient. However, after a good night's sleep offering a little extra perspective, this may be due to Kconfig error somewhere, but as I was debugging the various cases at the same time, I had painted it all with the same brush.

I'll dig a little more.

@peter-mitsis
Copy link
Contributor Author

@cfriedt - I did some more digging into the minimal libc test case and it looks like it is presently impossible to use minimal libc with tests/lib/c_lib/thrd .

Its prj.conf enables POSIX_API.
POSIX_API enables POSIX_AEP_REALTIME_MINIMAL.
POSIX_AEP_REALTIME_MINIMAL enables POSIX_DEVICE_IO.
POSIX_DEVICE_IO enables REQUIRES_FULL_LIBC.
REQUIRES_FULL_LIBC prevents MINIMAL_LIBC from being selected.

With that in mind, I am leaning to dropping the minimal_libc case for now and re-enabling it in the future if the dependency chain changes to allow it.

@cfriedt
Copy link
Member

cfriedt commented Oct 29, 2025

Actually, @peter-mitsis - POSIX_DEVICE_IO should not depend on REQUIRES_FULL_LIBC and that dependency is removed as part of #97855.

If you check out that branch and run the following, you can verify:

twister -c -p qemu_riscv64 -T tests/lib/c_lib
Deleting output directory /home/cfriedt/zephyrproject/zephyr/twister-out
INFO    - Using Ninja..
INFO    - Zephyr version: v4.3.0-rc1-118-g90441bf7e945
INFO    - Using 'zephyr' toolchain.
INFO    - Building initial testsuite list...
INFO    - Writing JSON report /home/cfriedt/zephyrproject/zephyr/twister-out/testplan.json
INFO    - JOBS: 32
INFO    - Adding tasks to the queue...
INFO    - Added initial list of jobs to queue
INFO    - Total complete:   24/  24  100%  built (not run):    0, filtered:    0, failed:    0, error:    0
INFO    - 24 test scenarios (24 configurations) selected, 0 configurations filtered (0 by static filter, 0 at runtime).
INFO    - 24 of 24 executed test configurations passed (100.00%), 0 built (not run), 0 failed, 0 errored, with no warnings in 145.38 seconds.
INFO    - 399 of 399 executed test cases passed (100.00%) on 1 out of total 1259 platforms (0.08%).
INFO    - 18 selected test cases not executed: 18 skipped.
INFO    - 24 test configurations executed on platforms, 0 test configurations were only built.
INFO    - Saving reports...
INFO    - Writing JSON report /home/cfriedt/zephyrproject/zephyr/twister-out/twister.json
INFO    - Writing xunit report /home/cfriedt/zephyrproject/zephyr/twister-out/twister.xml...
INFO    - Writing xunit report /home/cfriedt/zephyrproject/zephyr/twister-out/twister_report.xml...
INFO    - Run completed

Feel free to remove the test configuration if it unblocks you.

CC @nashif

Inspection of the build log shows that the arcmwdt toolchain
overrides the enablement of PICOLIBC to use ARCMWDT_LIBC as
it does not support picolibc. This means that filtering on
ZEPHYR_PICOLIBC_MODULE is insufficient and we should be also
be filtering using PICOLIBC_SUPPORTED.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
Remove the libraries.libc.c11_threads.minimal test case as it is
presently an invalid configuration due. The enablement of POSIX_API
leads to the enablement of REQUIRES_FULL_LIBC, which in turn
disallows MINIMAL_LIBC.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
@peter-mitsis peter-mitsis force-pushed the pmitsis-picolibc-arcmwdt branch from 6428bdb to b2acf9c Compare October 29, 2025 20:49
@peter-mitsis
Copy link
Contributor Author

Updated. I split it into two commits, so that if #97855 is merged after this, then the removal of the minimal libc test case can be undone with a simple revert. If however it is merged before this PR, then I just have to remove that commit.

@sonarqubecloud
Copy link

Copy link
Member

@cfriedt cfriedt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@M-Moawad - would it be possible for you to add a configuration at some point in the future that correctly uses arcmwdt (and presumably undoes some of the Kconfig weirdness?). I'm happy to help at any point.

@M-Moawad
Copy link
Contributor

@peter-mitsis I agree, the filters are now working correctly after updating the picolibc_notls and picolibc_module cases.
Previously, the filters were neglected, and the libc defaulted to minimal_libc when using the ARCMWDT toolchain, even if PICOLIBC was explicitly enabled.

@cfriedt Using minimal_libc is actually the correct configuration for ARCMWDT.
The main issue now is that if ARCMWDT is ever configured with a libc other than minimal_libc or its own arcmwdt_libc, it should trigger an error — this would help detect any incomplete filters or misconfigurations early.

@cfriedt
Copy link
Member

cfriedt commented Oct 31, 2025

@peter-mitsis - is it Ok with you if this goes on the back-burner? I'd really like to see what the resolution is for #97855. If this change does not need to be applied (which would significantly shrink test coverage), then I would prefer to hold off, if possible.

@cfriedt cfriedt added the DNM This PR should not be merged (Do Not Merge) label Oct 31, 2025
@cfriedt
Copy link
Member

cfriedt commented Oct 31, 2025

Just a temporary DNM for the above reason, also noting that this is not tagged for the 4.3.0 release (yet), but I have no problem including it in the release if necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: C Library C Standard Library area: Tests Issues related to a particular existing or missing test DNM This PR should not be merged (Do Not Merge)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants